package yu.code.usercenter.common;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
public class BaseResponse<T> {
    int code;
    T data;
    String message;
    String description;
    public BaseResponse(int code, T data, String message,String description) {
        this.code = code;
        this.data = data;
        this.message = message;
        this.description = description;
    }
    public BaseResponse(int code, T data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }
    public BaseResponse(int code, T data) {
        this.code = code;
        this.data = data;
    }
    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(), null, errorCode.getMessage(), errorCode.getDescription());
    }
    public BaseResponse(ErrorCode errorCode,String description) {
        this(errorCode.getCode(), null, errorCode.getMessage(), description);
    }
    public BaseResponse(Integer code, String message,String description) {
        this(code, null, message, description);
    }
}
